


  $(document).ready(function(){
    let list = []
    let _orList = ciku.orList.substring(1, ciku.orList.length).split('","')
  let _codeList = ciku.codeList.substring(1, ciku.codeList.length).split('","')
  let _diffList = ciku.diffList.substring(1, ciku.diffList.length).split('","')
  let _umList = ciku.umList.substring(1, ciku.umList.length).split('","')
  let _umCodeList = ciku.umCodeList.substring(1, ciku.umCodeList.length).split('","')

    $(".btn").click(function(){
        list = []
        let i,j
        let _key = $('#exampleInputName2').val()
        for (i = 0; i < _key.length; i++) {
            for (j = 0; j < _orList.length; j++) {
              if (_orList[j] == _key[i]) {
                 list.push({
                    org: _key,
                    code: _codeList[j],
                    diff: _diffList[j],
                    um: _umList[j],
                    umCode: _umCodeList[j]
                 })
              }
          }
        }
          let htmlCode = ''
          for (let i = 0 ; i < list.length; i++) {
              htmlCode += `
              <div class="result-box">
              <div>
              <div><span class="fc-gray">字头：</span><span class="fb-6">${list[i].org}</span></div>
              <div><span class="fc-gray">编码：</span><span class="fb-6">${list[i].code}</span></div>
              <div><span class="fc-gray">拆分：</span><span class="fb-6">${list[i].diff}</span></div>
              <div><span class="fc-gray">首末：</span><span class="fb-6">${list[i].um}</span></div>
              <div><span class="fc-gray">首末码：</span><span class="fb-6">${list[i].umCode}</span></div>


              <div><span class="fc-gray"> 字统：</span><span class="fb-6"><a href="https://zi.tools/zi/${list[i].org}" target="_blank" >查看字统</a></span></div>
            

                    </div>
                    </div>
              `
          $('.result').html(htmlCode)

        }
    });
    $("input").keydown(function(event){
      if (event.which == 13) {
        list = []
        let i,j
        let _key = $('#exampleInputName2').val()
        for (i = 0; i < _key.length; i++) {
            for (j = 0; j < _orList.length; j++) {
              if (_orList[j] == _key[i]) {
                 list.push({
                    org: _key,
                    code: _codeList[j],
                    diff: _diffList[j],
                    um: _umList[j],
                    umCode: _umCodeList[j]
                 })
              }
          }
        }
          let htmlCode = ''
          for (let i = 0 ; i < list.length; i++) {
              htmlCode += `
              <div class="result-box">
              <div>
              <div><span class="fc-gray">字头：</span><span class="fb-6">${list[i].org}</span></div>
              <div><span class="fc-gray">编码：</span><span class="fb-6">${list[i].code}</span></div>
              <div><span class="fc-gray">拆分：</span><span class="fb-6">${list[i].diff}</span></div>
              <div><span class="fc-gray">首末：</span><span class="fb-6">${list[i].um}</span></div>
              <div><span class="fc-gray">首末码：</span><span class="fb-6">${list[i].umCode}</span></div>


              <div><span class="fc-gray"> 字统：</span><span class="fb-6"><a href="https://zi.tools/zi/${list[i].org}" target="_blank" >查看字统</a></span></div>
            

                    </div>
                    </div>
              `
          $('.result').html(htmlCode)

        }
          
      }
    });
  });